package com.talkology.pilot.student.service.impl;

import com.talkology.pilot.database.dao.PayCountMapper;
import com.talkology.pilot.database.model.PayCount;
import com.talkology.pilot.student.service.IPayCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class PayCountServiceImpl implements IPayCountService {
    @Autowired
    private PayCountMapper mapper;


    @Override
    public List<PayCount> getAllByFilter(String number, String consumer, Integer status,
                                         String startTime, String endTime, Integer minAmount) {

        return mapper.getAllByFilter(number, consumer, status, startTime, endTime, minAmount);
    }

    @Override
    public PayCount getInfo(Long index) {
        return mapper.selectByPrimaryKey(index);
    }

    @Override
    public void add(PayCount record) {
        mapper.insert(record);
    }

    @Override
    public void edit(PayCount record) {
        mapper.updateByPrimaryKey(record);
    }

    @Override
    public void delete(Long index) {
        mapper.deleteByPrimaryKey(index);
    }
}
